import Vue from "vue"
import Router from "vue-router"
import Login from "./views/login.vue"
import Admin from "./views/admin.vue"
import Welcome from "./views/admin/welcome.vue"
import Student from "./views/admin/userStudent.vue"
import Teacher from "./views/admin/userTeacher.vue"
import User from "./views/admin/userInfo.vue"
import College from "./views/admin/collegeInfo.vue"
import Major from "./views/admin/majorInfo.vue"
import Class from "./views/admin/classInfo.vue"
import Course from "./views/admin/courseInfo.vue"
import StudentChart from "./views/chart/studentChart.vue"
import CollegeChart from "./views/chart/collegeChart.vue"

Vue.use(Router)

export default new Router({
    mode: "history",
    base: process.env.BASE_URL,
    routes: [{
        path: "*",
        redirect: "/login",
    },{
        path: "/",
        component: Login
    },{
        path: "/login",
        component: Login
    },{
        path: "/",
        name: "admin",
        component: Admin,
        meta:{
          loginRequire:true
        },
        children: [{
            path: "welcome",
            name: "welcome",
            component: Welcome,
        }, { // 学生信息管理
            path: "user/studentInfo",
            name: "user/studentInfo",
            component: Student,
        }, { // 教师信息管理
            path: "user/teacherInfo",
            name: "user/teacherInfo",
            component: Teacher,
        }, { // 管理员管理
            path: "user/userInfo",
            name: "user/userInfo",
            component: User,
        }, { // 学院管理
            path: "study/collegeInfo",
            name: "study/collegeInfo",
            component: College,
        }, { // 专业管理
            path: "study/majorInfo",
            name: "study/majorInfo",
            component: Major,
        }, { // 班级管理
            path: "study/classInfo",
            name: "study/classInfo",
            component: Class,
        }, { // 课程管理
            path: "study/courseInfo",
            name: "study/courseInfo",
            component: Course,
        }, { // 学生视图
            path: "chart/studentChart",
            name: "chart/studentChart",
            component: StudentChart,
        }, { // 学院视图
            path: "chart/collegeChart",
            name: "chart/collegeChart",
            component: CollegeChart,
        }]
    }]
})